import { useUserStore } from '@/store/user'

export default {
  mounted(el, binding) {
    const store = useUserStore()
    const value = binding.value
    if (value && Array.isArray(value)) {
      const hasPermission = store.hasPermission(value[0])
      // console.log('hasPermission', hasPermission,'value',value)
      if (!hasPermission) {
        el.parentNode && el.parentNode.removeChild(el)
      }
    }
  }
} 